package com.plum.admin.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.plum.admin.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author 子丶沫
 * @since 2021-08-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value="SysMenu对象", description="菜单权限表")
public class SysMenu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "菜单权限标识")
    @TableField("permission")
    private String permission;

    @ApiModelProperty(value = "前端跳转URL")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "菜单组件")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "父菜单ID")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty(value = "标题")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "菜单类型 （类型   0：目录   1：菜单   2：按钮）")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "菜单等级")
    @TableField("level")
    private Integer level;

    @ApiModelProperty(value = "是否禁用")
    @TableField("disabled")
    private Boolean disabled;

    @ApiModelProperty(value = "是否缓存0否1是")
    @TableField("keep_alive")
    private Integer keepAlive;

    @TableField("active_menu")
    private String activeMenu;

    @TableField("is_root")
    private Boolean isRoot;

    @TableField("frame_src")
    private String frameSrc;

    @TableField(exist = false)
    private Set<String> permissionList;

    @ApiModelProperty(value = "重定向")
    @TableField("redirect")
    private String redirect;

    @ApiModelProperty(value = "聚合路由")
    @TableField("always_show")
    private Boolean alwaysShow;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<SysMenu> children;
    @TableField(exist = false)
    private String label;
}
